home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue24 / tiptrix / LISTING5.PAS < prev   
Encoding:
Pascal/Delphi Source File  |  1997-07-21  |  577 b   |  19 lines

  1. function ReturnJustFileName( const s : string ) : string;
  2. var
  3.   sExtension : string;
  4.   sFullFileName : string;
  5. begin
  6.   sFullFileName := ExtractFileName(s);
  7.   sExtension  := ExtractFileExt(sFullFileName);
  8.   Result := Copy(sFullFileName, 1,
  9.     Length(sFullFileName)-Length(sExtension) );
  10. end;
  11. function ReplaceFileExt( const sFullFileName : string;
  12.   const NewExt : string ):string;
  13. var sFileExt : string;
  14. begin
  15.   sFileExt  := ExtractFileExt(sFullFileName);
  16.   Result := Copy(sFullFileName, 1, Length(sFullFileName) -
  17.     Length(sFileExt) ) + æ.Æ + NewExt;
  18. end;
  19.